<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="cp" value="${pageContext.request.contextPath}"/>
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>购物车</title>
  <link rel="stylesheet" href="${cp}/css1/reset.css">
  <link rel="stylesheet" href="${cp}/css1/carts.css">
  <link href="${cp}/css/bootstrap.min.css" rel="stylesheet">
  <link href="${cp}/css/style.css" rel="stylesheet">
  <script src="${cp}/js/jquery.min.js" type="text/javascript"></script>
  <script src="${cp}/js/bootstrap.min.js" type="text/javascript"></script>
  <script src="${cp}/js/layer.js" type="text/javascript"></script>
  <script language="javascript">
    function firm()
    {
      if (confirm("你确定要删除该商品"))
      {
        location.href ="${cp}/cart/deleteCart.do?cartid=${item.cartid}";
      }
    }
  </script>
</head>
<body>

<jsp:include page="include/header.jsp"/>

<div class="container-fluid bigHead">
  <div class="row">
    <section class="cartMain">
      <div class="cartMain_hd">
        <ul class="order_lists cartTop">
            <li class="list_chk" style="color: red">
              <!--所有商品全选-->
              <input type="checkbox" id="all" class="whole_check"><label for="all"></label>全选</li>
          <h3 style="color: cadetblue">
            <li class="list_con">商品名字</li>
            <li class="list_info">商品信息</li>
            <li class="list_price">单价</li>
            <li class="list_amount">数量</li>
            <li class="list_sum">金额</li>
            <li class="list_op">操作</li>
          </h3>
        </ul>
      </div>
      <div class="cartBox">
        <div class="shop_info">
          <div class="all_check">
            <!--店铺全选-->
            <input type="checkbox" id="shop_a" class="shopChoice">
          </div>

          <div class="shop_name">
            <a href="javascript:;">${item.product.type}</a>
          </div>

        </div>
        <div class="order_content">
          <c:forEach  items="${cart}" var="item">
            <ul class="order_lists">

              <li class="list_chk">
                <input type="checkbox" id="checkbox_2" class="son_check">
                <label for="checkbox_2"></label>
              </li>

              <li class="list_con">
                <div class="list_img"><a href="javascript:;"><img src="${cp}/static/${item.product.image}"></a></div>
                <div class="list_text"><a href="javascript:;">${item.product.pname}</a></div>
              </li>

              <li class="list_info">
                <p>${item.product.describe}</p>
              </li>

              <li class="list_price">
                <p class="price">${item.product.price}</p>
              </li>

              <li class="list_amount">
                <div class="amount_box">
                  <a href="javascript:;" class="reduce reSty">-</a>
                  <input type="text" value="${item.quantity}" class="sum">
                  <a href="javascript:;" class="plus">+</a>
                </div>
              </li>

              <li class="list_price">
                <p class="price">${item.product.price*item.quantity}</p>
              </li>

              <li class="list">
                <p class="del">
                  <a href="${cp}/cart/deleteCart.do?cartid=${item.cartid}" class="delBtn">
                    <input type="submit" name="Submit" value="移除商品" onclick="firm()"/>
                  </a>
                </p>
              </li>
            </ul>
          </c:forEach>
        </div>
      </div>

      <!--底部-->
      <div class="bar-wrapper">
        <div class="bar-right">
          <div class="totalMoney">共计: <strong class="total_text">${total}</strong></div>
          <div class="calBtn"><a href="${cp}/order/createOrder.do?total=${total}&itemid=${itemid}">结算</a></div>
          <div class="clear"><a href="${cp}/cart/cleanCart.do">清空购物车</a></div>
        </div>
      </div>
    </section>
    <section class="model_bg"></section>
  </div>
</div>

<script src="${cp}/js1/jquery.min.js"></script>
<script src="${cp}/js1/carts.js"></script>

</body>
</html>